package com.example.shengyin.dao;
import com.example.shengyin.entity.City;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public interface CityMapper {

    public City select(@Param("id") Long id);


    // 根据id查下级省/市/区
    public List<City> selectById(@Param("id") Long id);


    // 根据name查其id
    public Long selectIdByName(@Param("name") String name);

    // 根据parentid查上级的name
    public String selectNameByParentid(@Param("parentid")Long parentid);


    //根据id查id所对应的省份名
    public String selectParentNameById(@Param("id")Long id);

    public List<City> list(@Param("pagestart")int pagestart, @Param("limit") int limit, @Param("name") String name);


    public int insert(City city);

    public int update(City city);


    public int delete(@Param("id") int id);

    public int count(@Param("name") String name);

    public int deleteByIds(@Param("ids") String ids);
}
